*{
    margin: 0;
    padding: 0;
}

body , .nav , .menu {
     display: flex;
     justify-content: center;
     align-items: center;
 }
 .nav {
     position: relative;
     margin: 30px;
     background-color: #fff;
     padding: 10px;
     transform: 0.5s;
     border-radius: 50px;
     overflow: hidden;
     box-shadow: 0 8px 15px rgba(0,0,0,.2);
 }
 .menu {
     margin: 0;
     padding: 0;
     width: 0;
     overflow: hidden;
     transition: 0.5s;
 }
 .nav input:checked ~ .menu {
     width: 400px;

 }
 .menu li {
     list-style: none;
     margin: 0 10px;

 }
 .menu li a{
     text-decoration: none;
     color: #666;

     font-weight: 600;
     transition: 0.5s;

 }
 .menu li a:hover {
     color: cadetblue;
 }
 .nav input {
     width: 50px;
     height: 30px;
     cursor: pointer;
     opacity: 0;
 }
 .nav span {
     position: absolute;
     left: 20px;
     width: 30px;
     height: 4px;
     border-radius: 50px;
     background-color: #666;
     pointer-events: none;
     transition: 0.5s;
 }
 .nav input:checked ~span {
     background-color: antiquewhite;
 }
 .nav span:nth-child(2) {
     transform: translateY(-8px);
 }
 .nav input:checked ~ span:nth-child(2) {
     transform: translateY(0) rotate(-45deg);
 }
 .nav span:nth-child(3) {
     transform: translateY(8px);
 }
 .nav input:checked ~ span:nth-child(3) {
     transform: translateY(0) rotate(45deg);
 }




body{
    background: black;
}
.center{
    position: absolute;
    top:50%;
    left:50%;
    transform: translate(-50%,-50%);
}

.box{
    position: relative;
    padding: 10px;
    width:500px;
    height: 400px;
    color: white;
    /*透明*/
    background: transparent;
    box-sizing: border-box;
    transition: 1s;
    border-radius: 10px;
}

.box p{
    margin: 10px;
    padding:10px;
    text-align: center;
    font-size: 3em;
    transition: 1s;
}

.box h2{
    margin: 80px 0 60px;
    text-align: center;
    transition: 1s;
}

.box::before{
    content: '';
    position: absolute;
    top:50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 0;
    height: 0;
    z-index: -1;
    background: #ffffff;
    transition: 1s;
}

.box:hover::before{
    width: 100%;
    height: 100%;
}

.box:hover{
    border: 5px solid #fff;
    box-shadow: 0 15px 25px rgba(0,0,0,.5);
}

.box:hover p,
.box:hover h2{
    color: black;
}
